#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	char str[101];
	while (scanf("%s", str) > 0) {
		int n;
		scanf("%d", &n);
		str[n] = '\0';
		printf("%s\n", str);
	}
	return 0;
}